package com.huike.service.impl;

import com.huike.dto.domain.RulePool;
import com.huike.mapper.RulePoolMapper;
import com.huike.service.IRulePoolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RulePoolServiceImpl implements IRulePoolService{

    @Autowired
    private RulePoolMapper rulePoolMapper;


    /**
     * 查询线索池规则
     *
     * @param id 线索池规则ID
     * @return 线索池规则
     */
    @Override
    public RulePool selectRulePoolById(Long id) {
        return rulePoolMapper.selectRulePoolById(id);
    }

    /**
     * 查询不同类型线索池
     *
     * @param type
     * @return 线索池规则
     */
    @Override
    public RulePool selectRulePoolByType(String type) {
        return rulePoolMapper.selectRulePoolByType(type);
    }

    /**
     * 查询线索池规则列表
     *
     * @param rulePool
     * @return 线索池规则集合
     */
    @Override
    public List<RulePool> selectRulePoolList(RulePool rulePool) {
        return rulePoolMapper.selectRulePoolList(rulePool);
    }

    /**
     * 新增线索池规则
     *
     * @param rulePool
     * @return 结果
     */
    @Override
    public int insertRulePool(RulePool rulePool) {
        return rulePoolMapper.insertRulePool(rulePool);
    }

    /**
     * 修改线索池规则
     *
     * @param rulePool
     * @return 结果
     */
    @Override
    public int updateRulePool(RulePool rulePool) {
        return rulePoolMapper.updateRulePool(rulePool);
    }

    /**
     * 批量删除线索池规则
     *
     * @param ids 需要删除的线索池规则ID
     * @return 结果
     */
    @Override
    public int deleteRulePoolByIds(Long[] ids) {
        return rulePoolMapper.deleteRulePoolByIds(ids);
    }

    /**
     * 删除线索池规则信息
     *
     * @param id 线索池规则ID
     * @return 结果
     */
    @Override
    public int deleteRulePoolById(Long id) {
        return rulePoolMapper.deleteRulePoolById(id);
    }
}
